<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>   
<%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core_rt" %>  <%-- ie버전 확인에 쓰기 위해 씀 --%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>잔여위험평가</title>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--말 줄임 css(모든 브라우저 적용)-->
<style type="text/css">
.ellipsis{
	white-space:nowrap;
	text-overflow:ellipsis;		/* IE, Safari */
	-o-text-overflow:ellipsis;		/* Opera under 10.7 */
	overflow:hidden;			/* "overflow" value must be different from "visible" */ 
	-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>


<script type="text/javascript">
function winClose(){
	window.close();
}
</script>
</head>
<body>
<c:if test="${sessionScope.USER_ID==null}">
		<script type="text/javascript">
			alert("연결이 끊어졌습니다. 다시 로그인 해주시기 바랍니다");
			window.close();
		</script>	
</c:if>
<div class="box">
	<h4 class="white">잔여위험평가<span class="yellow"> | 위험명 : ${requestScope.calvo.risk_id } | </span><span class="yellow ellipsis" style="width:400px; position: fixed;"> 위험정의 : ${requestScope.vo.risk_nm }</span></h4>
        <div class="box-container1"> 
	<%-- 위험수준 산정 및 평가 시작 --%>
	   		<table class="insertTable" style="width: 740px; margin: 0 auto;">
	   			<tfoot>
	   				<tr>
	   					<td>
	                     	<div class="align-right"><a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a></div>
	                     </td>
	   				</tr>
	   			</tfoot>
	   		</table>
	   		
			<%--위험처리방안선정 시작 --%>
		   	<table class="mr3Table" style="width: 740px;table-layout: fixed; margin: 0 auto;">
		   		<colgroup>
		   			<col width="80px"/>
	   				<col width="120px"/>
	   				<col width="120px"/>
	   				<col/>
		   		</colgroup>
		   		<tbody>
		   			<tr>
		   				<th rowspan="7" class="bRLine">위험처리계획</th>
		   				<th height="20px"  class="bBLine">위험처리담당자</th>
		   				<td colspan="2">
		   					${requestScope.tplanvo.risk_people }
		   				</td>
		   			</tr>
		   			<tr>
		   				<th rowspan="2" class="bBLine">위험처리방안</th>
		   				<td colspan="2" class="col-alignCenter">
		   					<span><input type="radio" name="MR3risk_treat1" id="MR3risk_treat11" value="1" disabled="disabled"<c:if test="${requestScope.tplanvo.risk_treat1==1 }">checked='checked'</c:if> /> <label for="MR3risk_treat11" style="cursor:pointer">완화</label></span>
							<span><input type="radio" name="MR3risk_treat1" id="MR3risk_treat12" value="2" disabled="disabled"<c:if test="${requestScope.tplanvo.risk_treat1==2 }">checked='checked'</c:if> /> <label for="MR3risk_treat12" style="cursor:pointer">보유</label></span>
							<span><input type="radio" name="MR3risk_treat1" id="MR3risk_treat13" value="3" disabled="disabled"<c:if test="${requestScope.tplanvo.risk_treat1==3 }">checked='checked'</c:if> /> <label for="MR3risk_treat13" style="cursor:pointer">회피</label></span>
							<span><input type="radio" name="MR3risk_treat1" id="MR3risk_treat14" value="4" disabled="disabled"<c:if test="${requestScope.tplanvo.risk_treat1==4 }">checked='checked'</c:if> /> <label for="MR3risk_treat14" style="cursor:pointer">전가</label></span>
		   				</td>
		   			</tr>
		   			<tr>
		   				<td colspan="2">
		   					<textarea class="read_textfiled" name="MR3risk_treat2" rows="4" cols="93" id="MR3risk_treat2" readonly="readonly">${requestScope.tplanvo.risk_treat2 }</textarea>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th rowspan="4" >위험처리 후<br/>위험 수준 및 등급<br/>(예측)</th>
		   				<td>자산 취약성 등급</td>
		   				<td class="col-alignCenter">
						 <c:forEach var="vlList" items="${requestScope.vlList}" varStatus="status">
	   						<span><input type="radio" name="MR3v_score" id="MR3v_score${status.index+1 }" value="<fmt:formatNumber value="${vlList.base_cnt }" pattern="0"/>" disabled="disabled" <c:if test="${requestScope.tplanvo.v_score==vlList.base_cnt }">checked='checked'</c:if> /> <label for="MR3v_score${status.index+1 }">${vlList.base_lev2 }(<fmt:formatNumber value="${vlList.base_cnt }" pattern="0"/>)</label></span>
	   					</c:forEach>
		   				</td>
		   			</tr>
		   			
		   			<tr>
		   				<td>위험발생가능성</td>
		   				<td class="col-alignCenter">
		   				
						 		 <c:forEach var="rbList" items="${requestScope.rbList}" varStatus="status">
			   						<span><input type="radio"  name="MR3riskb_poss" id="MR3riskb_poss${status.index+1 }" value="<fmt:formatNumber value="${rbList.base_cnt }" pattern="0"/>"  disabled="disabled" <c:if test="${requestScope.tplanvo.riskb_poss==rbList.base_cnt }">checked='checked'</c:if> /> <label for="MR3riskb_poss${status.index+1 }" style="cursor:pointer">${rbList.base_lev2 }(<fmt:formatNumber value="${rbList.base_cnt }" pattern="0"/>)</label></span>
			   					</c:forEach>
		   					
		   				</td>
		   			</tr>
		   			<tr>
		   				<td>위험수준</td>
		   				<td class="col-alignCenter">
	   							   
	   						<c:if test="${calvo.sy_score==null }">0</c:if>${calvo.sy_score } &times; 
	   						<c:if test="${tplanvo.v_score==null }">0</c:if>${tplanvo.v_score } &times; 
	   						<c:if test="${tplanvo.riskb_poss==null }">0</c:if>${tplanvo.riskb_poss } = 
	   						<span class="red"><c:if test="${tplanvo.risk_degree==null }">0</c:if>${tplanvo.risk_degree } </span>
	   						(max <c:if test="${requestScope.rvatotal==null }">0</c:if>${requestScope.rvatotal }), 
	   						<c:if test="${requestScope.chRvatotal==null }">0</c:if>${requestScope.chRvatotal }점 척도 환산점수 
	   						<fmt:formatNumber value="${tplanvo.risk_degree*1.67 }" pattern="0"/> 점
	   						
		   				</td>
		   			</tr>
		   			<tr>
		   				<td>위험등급</td>
		   				<td class="col-alignCenter">
						 		<span><input type="radio" name="MR3risk_degrade" id="MR3risk_degrade1" value="1" disabled="disabled" <c:if test="${requestScope.tplanvo.risk_degrade==1 }">checked='checked'</c:if> /> <label for="MR3risk_degrade1" style="cursor:pointer">A등급 (높은 위험)</label></span>
								<span><input type="radio" name="MR3risk_degrade" id="MR3risk_degrade2" value="2" disabled="disabled" <c:if test="${requestScope.tplanvo.risk_degrade==2 }">checked='checked'</c:if> /> <label for="MR3risk_degrade2" style="cursor:pointer">B등급 (중간 위험)</label></span>
								<span><input type="radio" name="MR3risk_degrade" id="MR3risk_degrade3" value="3" disabled="disabled" <c:if test="${requestScope.tplanvo.risk_degrade==3 }">checked='checked'</c:if> /> <label for="MR3risk_degrade3" style="cursor:pointer">C등급 (낮음 위험)</label></span>
		   				</td>
		   			</tr>
		   			<%--
		   			<tr>
		   				<th height="20px">처리기한</th>
		   				<td colspan="2" class="col-alignCenter">
		   					FROM : ${requestScope.tplanvo.treat_sday}
		   					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		   					TO : ${requestScope.tplanvo.treat_lday}
		   				</td>
		   			</tr>
		   			<tr>
		   				<th height="20px">처리상태</th>
		   				<td colspan="2" class="col-alignCenter">
		   					<span><input type="radio" name="MR3treat_state" id="MR3treat_state1" value="1"  disabled="disabled" <c:if test="${requestScope.tplanvo.treat_state==1 }">checked='checked'</c:if> /> <label for="MR3treat_state1" style="cursor:pointer">계획수립</label></span>
							<span><input type="radio" name="MR3treat_state" id="MR3treat_state2" value="2" disabled="disabled" <c:if test="${requestScope.tplanvo.treat_state==2 }">checked='checked'</c:if> /> <label for="MR3treat_state2" style="cursor:pointer">처리 중</label></span>
							<span><input type="radio" name="MR3treat_state" id="MR3treat_state3" value="3" disabled="disabled" <c:if test="${requestScope.tplanvo.treat_state==3 }">checked='checked'</c:if> /> <label for="MR3treat_state3" style="cursor:pointer">종료검토</label></span>
							<span><input type="radio" name="MR3treat_state" id="MR3treat_state4" value="4" disabled="disabled" <c:if test="${requestScope.tplanvo.treat_state==4 }">checked='checked'</c:if> /> <label for="MR3treat_state4" style="cursor:pointer">종료승인</label></span>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th height="20px">최종갱신일자</th>
		   				<td colspan="2" class="col-rowspanMid col-alignCenter">
		   					${requestScope.tplanvo.final_renew_day}
		   				</td>
		   			</tr>
		   			
		   			 --%>
		   			<tr>
	   					<td colspan="4" style="border: 0px #fff;"></td>
	   				</tr>
		   		</tbody>
		   	</table>
		   	<%--위험처리방안선정 끝 --%>	

		<%--위험수용 시작--%>
		   	<table class="mr4Table" style="width: 740px;table-layout: fixed; margin: 0 auto;">
		   		<colgroup>
		   			<col width="80px"/>
	   				<col width="120px"/>
	   				<col width="120px"/>
	   				<col/>
		   		</colgroup>
		   		<tbody>
		   			<tr>
	   					<th rowspan="9" class="bRLine">잔여위험평가</th>
		   				<th class="bBLine">위험처리결과</th>
		   				<td colspan="2"><textarea class="read_textfiled" name="rt_result" rows="4" cols="93" id="rt_result" readonly="readonly">${requestScope.trevo.rt_result }</textarea></td>
		   			</tr>
		   			<tr>
		   				<th rowspan="7" class="bRLine bBLine">잔여위험<br/>(실측)</th>
		   				<th class="bBLine">자산 취약성 등급</th>
		   				<td class="col-alignCenter">
					 		 <c:forEach var="vlList" items="${requestScope.vlList}" varStatus="status">
		   						<span><input type="radio"  name="v_score" id="v_score${status.index+1 }" disabled="disabled" value="<fmt:formatNumber value="${vlList.base_cnt }" pattern="0"/>" <c:if test="${requestScope.trevo.v_score==vlList.base_cnt }">checked='checked'</c:if> /> <label for="v_score${status.index+1 }" style="cursor:pointer">${vlList.base_lev2 }(<fmt:formatNumber value="${vlList.base_cnt }" pattern="0"/>)</label></span>
		   					</c:forEach>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th class="bBLine">위험발생가능성</th>
		   				<td class="col-alignCenter">
					 		 <c:forEach var="rbList" items="${requestScope.rbList}" varStatus="status">
		   						<span><input type="radio" disabled="disabled" name="riskb_poss" id="riskb_poss${status.index+1 }" value="<fmt:formatNumber value="${rbList.base_cnt }" pattern="0"/>" <c:if test="${requestScope.trevo.riskb_poss==rbList.base_cnt }">checked='checked'</c:if> /> <label for="riskb_poss${status.index+1 }" style="cursor:pointer">${rbList.base_lev2 }(<fmt:formatNumber value="${rbList.base_cnt }" pattern="0"/>)</label></span>
		   					</c:forEach>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th class="bBLine">위험수준</th>
		   				<td class="col-alignCenter">
					 		<span id="syscore"><c:if test="${calvo.sy_score==null }">0</c:if>${calvo.sy_score }</span> 
   							&times; <span id="vscore"><c:if test="${trevo.v_score==null }">0</c:if>${trevo.v_score }</span>
   							 &times; <span id="riskbposs"> <c:if test="${trevo.riskb_poss==null }">0</c:if>${trevo.riskb_poss }</span>
   							  = <span id="riskdegree"><c:if test="${trevo.risk_degree==null }">0</c:if>${trevo.risk_degree }</span>
   							   (max <c:if test="${requestScope.rvatotal==null }">0</c:if>${requestScope.rvatotal }), 
   							   <c:if test="${requestScope.chRvatotal==null }">0</c:if>${requestScope.chRvatotal }점 척도 환산점수 <span id="exChangeRD"><fmt:formatNumber value="${trevo.risk_degree*1.67 }" pattern="0"/></span> 점
		   				</td>
		   			</tr>
		   			<tr>
		   				<th class="bBLine">위험등급</th>
		   				<td class="col-alignCenter">
						 		<span><input type="radio" name="risk_degrade" id="risk_degrade1" value="1" disabled="disabled" <c:if test="${requestScope.trevo.risk_degrade==1 }">checked='checked'</c:if> /> <label for="risk_degrade1" style="cursor:pointer">A등급 (높은 위험)</label></span>
								<span><input type="radio" name="risk_degrade" id="risk_degrade2" value="2" disabled="disabled" <c:if test="${requestScope.trevo.risk_degrade==2 }">checked='checked'</c:if> /> <label for="risk_degrade2" style="cursor:pointer">B등급 (중간 위험)</label></span>
								<span><input type="radio" name="risk_degrade" id="risk_degrade3" value="3" disabled="disabled" <c:if test="${requestScope.trevo.risk_degrade==3 }">checked='checked'</c:if> /> <label for="risk_degrade3" style="cursor:pointer">C등급 (낮음 위험)</label></span>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th height="20px"  class="bBLine">잔여위험</th>
		   				<td>
		   					${requestScope.trevo.re_risk }
		   				</td>
		   			</tr>
		   			<tr>
		   				<th class="bBLine">위험수용여부</th>
		   				<td class="col-alignCenter">
		   					<span><input type="radio" name="doa_yn" id="doa_yn1" value="1" onclick="checkDoaYn()" disabled="disabled" <c:if test="${requestScope.trevo.doa_yn==1 }">checked='checked'</c:if> /> <label for="doa_yn1" style="cursor:pointer">수용</label></span>
							<span><input type="radio" name="doa_yn" id="doa_yn2" value="2" onclick="checkDoaYn()" disabled="disabled" <c:if test="${requestScope.trevo.doa_yn==2 }">checked='checked'</c:if> /> <label for="doa_yn2" style="cursor:pointer">재 계획</label></span>
							<span><input type="radio" name="doa_yn" id="doa_yn3" value="3" onclick="checkDoaYn()" disabled="disabled" <c:if test="${requestScope.trevo.doa_yn==3 }">checked='checked'</c:if> /> <label for="doa_yn3" style="cursor:pointer">재 평가</label></span>
							<span><input type="radio" name="doa_yn" id="doa_yn4" value="4" onclick="checkDoaYn()" disabled="disabled" <c:if test="${requestScope.trevo.doa_yn==4 }">checked='checked'</c:if> /> <label for="doa_yn4" style="cursor:pointer">재 이행</label></span>
		   				</td>
		   			</tr>
		   			<tr>
		   				<th class="bBLineB">위험수용사유</th>
		   				<td><textarea class="read_textfiled" name="doa_text" rows="4" cols="69" id="doa_text" readonly="readonly">${requestScope.trevo.doa_text }</textarea></td>
		   			</tr>
		   			<tr>
		   				<th height="20px">최종갱신일자</th>
		   				<td colspan="2" class="col-rowspanMid col-alignCenter">
		   					${requestScope.trevo.final_renew_day}
		   				</td>
		   			</tr>
		   			<tr>
	   					<td colspan="4" style="border: 0px #fff;"></td>
	   				</tr>
		   		</tbody>
		   	</table>
		   	<%--위험수용 끝--%>


  		</div><!-- end of div.box-container1 -->
</div> <!-- end of div.box -->
</body>
</html>